// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router/index'
import Axios from 'axios'
import store from './vuex/vuex'
import '../static/reset.css'

Vue.prototype.$http = Axios
Vue.config.productionTip = false;

router.beforeEach((to,from,next) => {
	if(to.matched.some(record => record.meta.logined)) {
		if(sessionStorage.login == 1) {
			next();
		} else {
			next({
				path: '/home/login'
			})
		}
	} else {
		next();
	}
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
